#ifndef __NET_ACCESS_AUDIT_MANAGER_H__
#define __NET_ACCESS_AUDIT_MANAGER_H__

#include "pcap_monitor.h"

#include <QObject>
#include <QStringList>
#include <QMap>

#include <vector>
#include <memory>

class NetAccessAuditManager : public QObject
{
    Q_OBJECT
public:
    NetAccessAuditManager(QObject *parent = nullptr);
    ~NetAccessAuditManager();

    void refresh(const QStringList &ips, const QStringList &ports);
Q_SIGNALS:
    void accessNotify(const QString &ip, int port);
private slots:
    void onAccessNotify(const QString &ip, int port);

private:
    std::vector<std::shared_ptr<PcapMonitor>> m_monitors;

    QStringList m_ips;
    QStringList m_ports;

    QMap<QString, QString> m_ip2Dns;
};

#endif